import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/home', component: () => import('@/components/Home.vue') },
  { path: '/movie', component: () => import('@/components/Movie.vue') },
  {
    path: '/about',
    component: () => import('@/components/About.vue'),
    children: [
      {
        path: '',
        name: 'about',
        component: () => import('@/components/tabs/Tab1.vue')
      },
      { path: '/about/tab2', component: () => import('@/components/tabs/Tab2.vue') }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
